package com.g001.model.abilities;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.geom.Vector2f;
import org.newdawn.slick.state.StateBasedGame;

import com.g001.util.CachedResourceLoader;

public class Shield extends Power {
	
	private final static int WIDTH = 28;
	private final static int HEIGTH = 45;
	private String str;
	
	
	public Shield(final int value, final int max, final Vector2f position) throws SlickException {
		super(value, max, position);
		image = CachedResourceLoader.getInstance().getImage("data/g001/blocks.png").getSubImage(323, 412, 57, 66);
	}
 

	@Override
	public void render(GameContainer container, StateBasedGame game, Graphics g)
			throws SlickException {
		str = getValue()+"/"+getMax();
		g.drawImage(image, position.x + CachedResourceLoader.fontSmall.getWidth(str)/2 - image.getWidth()/2, position.y);		
		CachedResourceLoader.fontSmall.drawString(position.x, position.y+image.getHeight()/2,str);
	}

	@Override
	public void update(GameContainer container, StateBasedGame game, int delta)
			throws SlickException {
	}

}
